#include "cameraDrv.h"
#include "sctdef.h"

AP_PLAT_COMMON_DATA camI2cCfg_t sp0821_2sdrRegInfo[] = 
{
	{0x30,0x01},
	{0x32,0x00},
	{0x03,0x00},
	{0x04,0x96},
	{0x24,0x13},
	{0x9b,0x32},
	{0xd7,0x00},
	{0xc5,0xc7},
	{0xc6,0xe2},
	{0xe7,0x03},
	{0x32,0x00},
	{0x32,0x01},
	{0x32,0x00},
	{0xbf,0x0f},
	{0xba,0x5a},
	{0xbb,0x69},
	{0xe7,0x00},
	{0x32,0x07},
	{0x31,0x03},
	{0x19,0x04},
	{0x2c,0x0f},
	{0x2e,0x3c},
	{0x30,0x01},
	{0x28,0x2e},
	{0x29,0x1f},
	{0x0f,0x30},
	{0x14,0xb0},
	{0x38,0x50},
	{0x39,0x52},
	{0x3a,0x60},
	{0x3b,0x10},
	{0x3c,0xe0},
	{0x85,0x01},
	{0xe0,0x02},
	{0xe5,0x60},
	{0xf5,0x02},
	{0xf1,0x03},
	{0xf3,0x40},
	{0x41,0x00},
	{0x05,0x00},
	{0x06,0x00},
	{0x07,0x00},
	{0x08,0x00},
	{0x09,0x00},
	{0x0a,0x34},
	{0x0D,0x01},
	{0xc8,0x10},
	{0x29,0x1e},
	{0xa2,0x26},
	{0xa3,0x02},
	{0xa4,0x32},
	{0xa5,0x00},
	{0xa8,0x32},
	{0xa9,0x00},
	{0xaa,0x01},
	{0xab,0x00},
	{0x4c,0x80},
	{0x4d,0x80},
	{0xa6,0xf0},
	{0xa7,0x20},
	{0xac,0xf0},
	{0xad,0x20},
	{0x8a,0x3e},
	{0x8b,0x30},
	{0x8c,0x2a},
	{0x8d,0x26},
	{0x8e,0x26},
	{0x8f,0x24},
	{0x90,0x24},
	{0x91,0x22},
	{0x92,0x22},
	{0x93,0x22},
	{0x94,0x20},
	{0x95,0x20},
	{0x96,0x20},
	{0x17,0x88},
	{0x18,0x80},
	{0x4e,0x78},
	{0x4f,0x78},
	{0x58,0x8a},
	{0x59,0xa8},
	{0x5a,0x80},
	{0xca,0x00},
	{0x86,0x08},
	{0x87,0x0f},
	{0x88,0x30},
	{0x89,0x45},
	{0x9e,0x94},
	{0x9f,0x88},
	{0x97,0x84},
	{0x98,0x88},
	{0x99,0x74},
	{0x9a,0x84},
	{0xa0,0x7c},
	{0xa1,0x78},
	{0x9d,0x09},
	{0xB1,0x04},
	{0xb3,0x00},
	{0x47,0x40},
	{0xb8,0x04},
	{0xb9,0x28},
	{0x3f,0x18},
	{0xc1,0xff},
	{0xc2,0x40},
	{0xc3,0xff},
	{0xc4,0x40},
	{0xc5,0xc7},
	{0xc6,0xe2},
	{0xc7,0xef},
	{0xc8,0x10},
	{0x50,0x2a},
	{0x51,0x2a},
	{0x52,0x2f},
	{0x53,0xcf},
	{0x54,0xd0},
	{0x5c,0x1e},
	{0x5d,0x21},
	{0x5e,0x1a},
	{0x5f,0xe9},
	{0x60,0x98},
	{0xcb,0x3f},
	{0xcc,0x3f},
	{0xcd,0x3f},
	{0xce,0x85},
	{0xcf,0xff},
	{0x79,0x5a},
	{0x7a,0xDC},
	{0x7b,0x0A},
	{0x7c,0xFD},
	{0x7d,0x46},
	{0x7e,0xFD},
	{0x7f,0xFD},
	{0x80,0xEF},
	{0x81,0x54},
	{0x1b,0x0a},
	{0x1c,0x0f},
	{0x1d,0x15},
	{0x1e,0x15},
	{0x1f,0x15},
	{0x20,0x1f},
	{0x21,0x2a},
	{0x22,0x2a},
	{0x56,0x49},
	{0x1a,0x14},
	{0x34,0x1f},
	{0x82,0x10},
	{0x83,0x00},
	{0x84,0xff},
	{0xd7,0x50},
	{0xd8,0x1a},
	{0xd9,0x20},
	{0xc9,0x1f},
	{0xbf,0x33},
	{0xba,0x37},
	{0xbb,0x38},

	{0x19,0x04},
	{0x34,0x1f},
	{0x30,0x01},
	{0x2e,0x2c},//0x29
	{0x2c,0x0f},

};

AP_PLAT_COMMON_DATA camI2cCfg_t sp0821_1sdrRegInfo[] = 
{
	{0x30,0x01},
	{0x32,0x00},
	{0x03,0x00},
	{0x04,0x96},
	{0x24,0x13},
	{0x9b,0x32},
	{0xd7,0x00},
	{0xc5,0xc7},
	{0xc6,0xe2},
	{0xe7,0x03},
	{0x32,0x00},
	{0x32,0x01},
	{0x32,0x00},
	{0xbf,0x0f},
	{0xba,0x5a},
	{0xbb,0x69},
	{0xe7,0x00},
	{0x32,0x07},
	{0x31,0x03},
	{0x19,0x04},
	{0x2c,0x0f},
	{0x2e,0x3c},
	{0x30,0x01},
	{0x28,0x2e},
	{0x29,0x1f},
	{0x0f,0x30},
	{0x14,0xb0},
	{0x38,0x50},
	{0x39,0x52},
	{0x3a,0x60},
	{0x3b,0x10},
	{0x3c,0xe0},
	{0x85,0x01},
	{0xe0,0x02},
	{0xe5,0x60},
	{0xf5,0x02},
	{0xf1,0x03},
	{0xf3,0x40},
	{0x41,0x00},
	{0x05,0x00},
	{0x06,0x00},
	{0x07,0x00},
	{0x08,0x00},
	{0x09,0x00},
	{0x0a,0x34},
	{0x0D,0x01},
	{0xc8,0x10},
	{0x29,0x1e},
	{0xa2,0x26},
	{0xa3,0x02},
	{0xa4,0x32},
	{0xa5,0x00},
	{0xa8,0x32},
	{0xa9,0x00},
	{0xaa,0x01},
	{0xab,0x00},
	{0x4c,0x80},
	{0x4d,0x80},
	{0xa6,0xf0},
	{0xa7,0x20},
	{0xac,0xf0},
	{0xad,0x20},
	{0x8a,0x3e},
	{0x8b,0x30},
	{0x8c,0x2a},
	{0x8d,0x26},
	{0x8e,0x26},
	{0x8f,0x24},
	{0x90,0x24},
	{0x91,0x22},
	{0x92,0x22},
	{0x93,0x22},
	{0x94,0x20},
	{0x95,0x20},
	{0x96,0x20},
	{0x17,0x88},
	{0x18,0x80},
	{0x4e,0x78},
	{0x4f,0x78},
	{0x58,0x8a},
	{0x59,0xa8},
	{0x5a,0x80},
	{0xca,0x00},
	{0x86,0x08},
	{0x87,0x0f},
	{0x88,0x30},
	{0x89,0x45},
	{0x9e,0x94},
	{0x9f,0x88},
	{0x97,0x84},
	{0x98,0x88},
	{0x99,0x74},
	{0x9a,0x84},
	{0xa0,0x7c},
	{0xa1,0x78},
	{0x9d,0x09},
	{0xB1,0x04},
	{0xb3,0x00},
	{0x47,0x40},
	{0xb8,0x04},
	{0xb9,0x28},
	{0x3f,0x18},
	{0xc1,0xff},
	{0xc2,0x40},
	{0xc3,0xff},
	{0xc4,0x40},
	{0xc5,0xc7},
	{0xc6,0xe2},
	{0xc7,0xef},
	{0xc8,0x10},
	{0x50,0x2a},
	{0x51,0x2a},
	{0x52,0x2f},
	{0x53,0xcf},
	{0x54,0xd0},
	{0x5c,0x1e},
	{0x5d,0x21},
	{0x5e,0x1a},
	{0x5f,0xe9},
	{0x60,0x98},
	{0xcb,0x3f},
	{0xcc,0x3f},
	{0xcd,0x3f},
	{0xce,0x85},
	{0xcf,0xff},
	{0x79,0x5a},
	{0x7a,0xDC},
	{0x7b,0x0A},
	{0x7c,0xFD},
	{0x7d,0x46},
	{0x7e,0xFD},
	{0x7f,0xFD},
	{0x80,0xEF},
	{0x81,0x54},
	{0x1b,0x0a},
	{0x1c,0x0f},
	{0x1d,0x15},
	{0x1e,0x15},
	{0x1f,0x15},
	{0x20,0x1f},
	{0x21,0x2a},
	{0x22,0x2a},
	{0x56,0x49},
	{0x1a,0x14},
	{0x34,0x1f},
	{0x82,0x10},
	{0x83,0x00},
	{0x84,0xff},
	{0xd7,0x50},
	{0xd8,0x1a},
	{0xd9,0x20},
	{0xc9,0x1f},
	{0xbf,0x33},
	{0xba,0x37},
	{0xbb,0x38},

	{0x19,0x04},
	{0x34,0x1f},
	{0x30,0x01},
	{0x2e,0x2c},//0x29
	{0x2c,0x0f},

};

uint16_t sp0821GetRegCnt(char* regName)
{
    if (strcmp(regName, "sp0821_2sdr") == 0)
    {
        return (sizeof(sp0821_2sdrRegInfo) / sizeof(sp0821_2sdrRegInfo[0]));
    }
    else if (strcmp(regName, "sp0821_1sdr") == 0)
    {
        return (sizeof(sp0821_1sdrRegInfo) / sizeof(sp0821_1sdrRegInfo[0]));
    }
    
    return 0;
}


